package com.tj.collection.db.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.tj.collection.db.dao.MerchantCodeMapDao;
import com.tj.collection.db.entity.MerchantCodeMapEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: Karl
 * Date: 2020-07-20
 * Time: 15:30:04.015
 */

@Repository
public class MerchantCodeMapDaoImpl extends AbstractBaseMapper<MerchantCodeMapEntity> implements MerchantCodeMapDao {

    @Override
    public MerchantCodeMapEntity selectMerchantCodeMapByMerchantCode(String merchantCode) {
        Map<String, Object> params = new HashMap<>();
        params.put("merchantCode", merchantCode);
        params.put("deleted", 0);
        List<MerchantCodeMapEntity> entityList = getSqlSession().selectList(this.getStatement("selectByParams"), params);
        if (entityList == null || entityList.size() == 0) {
            return null;
        }
        return entityList.get(0);
    }
}